﻿using LeanCloud;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WriteClick : MonoBehaviour {

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}
    public void Click()
    {
        Async();
    }

    async System.Threading.Tasks.Task Async()
    {
        AVClient.Initialize("bKNobM2wmMsD7ReQ1f2Py91W-gzGzoHsz", "zudIgpWooM5QChpsT4E1yAAY", "https://bknobm2w.lc-cn-n1-shared.com");

        AVQuery<AVObject> query = new AVQuery<AVObject>("GameEquipBag");
        //AVObject equipment = await query.GetAsync(Id_Find.Id);

        // 第一个参数是 className，第二个参数是 objectId
        var equipBag = AVObject.CreateWithoutData("GameEquipBag", Id_Find.Id);
        // 修改其中一个属性
        equipBag["scale"] = 30;


        // 保存到云端
        await equipBag.SaveAsync();
    }
}
